/**
 * Created by levy on 16/6/15.
 */
/**
 * @desc [遮罩层]
 * @args [displayNone] 传入隐藏父元素的函数
 * @args [LayoutBelong] 标识该遮罩层属于哪个组件的, 'form','layer'
 */
var MaskLayout = React.createClass({
    getDefaultProps: function () {
        return {
            layoutBelong: '',
            importantBelong: ''
        }
    },
    componentDidMount: function () {
        var me = this;
        React.findDOMNode(me.refs.maskLayout).addEventListener('tap', function ( ) {
            var belong = me.props.importantBelong || me.props.layoutBelong || '';
            me.props.displayNone && me.props.displayNone(belong);
        }, !1);
    },
    render: function () {
        return (
            <div ref="maskLayout" className="mask-layout" onTouchMove={this._touchMoveHandler} ></div>
        )
    },

    _touchMoveHandler: function ( event ) {
        event.preventDefault();
        event.stopPropagation();
    }
});

export default MaskLayout;
